package jmx;

import javax.management.MBeanServer;
import javax.management.ObjectName;

/**
 * @author zhaohaolin(zhaohaolin2010@gmail.com)
 */
public class HelloWorld implements HelloWorldMBean {

	@Override
	public String sayHello() {
		return "Hello, Guice Jmx";
	}

	public void register(MBeanServer server) {
		try {
			server.registerMBean(this, new ObjectName(
					"xylz guice demo:type=HelloWorld"));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
